package com.anti.jdbc.core.executor.meta.type;

import com.anti.jdbc.core.executor.meta.FieldElement;

import java.time.LocalDate;
import java.time.LocalDateTime;
import java.time.LocalTime;
import java.util.Date;


public class FillDateTypeHandler {

    public static  Object fillDate(FieldElement fieldElement){
        Object value=null;
        if(LocalDate.class.equals(fieldElement.getType())){
            value=LocalDate.now();
        }else if(fieldElement.getType().equals(Date.class)) {
            value=new Date();
        }else if(LocalDateTime.class.equals(fieldElement.getType())) {
            value=LocalDateTime.now();
        }else if(LocalTime.class.equals(fieldElement.getType())){
            value=LocalTime.now();
        }

        return value;
    }
}
